package com.yjzx.util.common.util.batch.mergingLimit;

import java.util.Collection;
import java.util.Iterator;

/**
 * @author guozhi
 * @date 2025/1/13
 * @description SlotManager
 */
public interface SlotManager<V extends Slot> extends Iterable<V> {
    Collection<V> getAllSlot();

    void addSlot(V v);

    default void addAllSlot(Collection<V> vs) {
        if (vs != null && !vs.isEmpty()) {
            for (V v : vs) {
                addSlot(v);
            }
        }
    }

    @Override
    default Iterator<V> iterator() {
        return getAllSlot().iterator();
    }
}
